<template>
  <div>
    <van-list
      v-model="loading"
      :finished="finished"
      finished-text="没有更多数据了"
      @load="onLoad"
    >
      <div
        v-for="item in list"
        :key="item.id"
        class="m-cost"
      >
        <div style="color: rgb(155, 155, 155);">{{ item.salon }}</div>
        <van-row>
          <van-col span="6"> {{ item.cdate }}</van-col>
          <van-col span="6"> {{ item.name }}</van-col>
          <van-col span="6" style="color:green;font-weight: bold;"> {{ item.money }}</van-col>
          <van-col v-if="item.status === 2" span="6" style="color:green">已确认</van-col>
          <van-col v-if="item.status === 1" span="6" style="color:rgba(194, 171, 45, 0.863)">待老板确认</van-col>
          <van-col v-if="item.status === 0" span="6">
            <van-button type="primary" size="small" block>确 认</van-button>
          </van-col>
        </van-row>
      </div>
    </van-list>
  </div>
</template>
<script>
import List from 'vant/lib/list'
import Row from 'vant/lib/row'
import Col from 'vant/lib/col'
import 'vant/lib/list/style'
import 'vant/lib/row/style'
import 'vant/lib/col/style'
import Button from 'vant/lib/button'
import 'vant/lib/button/style'
import { mapGetters } from 'vuex'
// import { getShopClerks } from '@/api/txs'

export default {
  components: {
    [Button.name]: Button,
    [List.name]: List,
    [Row.name]: Row,
    [Col.name]: Col
  },
  data () {
    return {
      list: [],
      loading: false,
      finished: false
    }
  },
  computed: {
    ...mapGetters(['openId'])
  },
  // created () {
  //   this.fetchData()
  // },
  methods: {
    onLoad () {
      this.loading = false
      // getShopClerks(this.openId).then(res => {
      //   this.list = res.data.data
      // })
      this.list = [
        { cdate: '2024/02', name: '房租', status: 0, money: '888￥', salon: '1号美容院' },
        { cdate: '2024/02', name: '宽带', status: 0, money: '888￥', salon: '1号美容院' },
        { cdate: '2024/02', name: '客情', status: 1, money: '888￥', salon: '2号美容院' },
        { cdate: '2024/02', name: '客情', status: 1, money: '888￥', salon: '2号美容院' },
        { cdate: '2024/01', name: '房租', status: 2, money: '888￥', salon: '3号美容院' },
        { cdate: '2024/01', name: '客情', status: 2, money: '888￥', salon: '3号美容院' }
      ]
      this.finished = true
    }
  }
}
</script>
<style lang="scss" scoped>
.m-cost{
  background-color: #fff;
  // color:#C31171;
  font-size: 26px;
  line-height: 60px;
  text-align: center;
  box-shadow: 0px 0px 5px rgb(201, 201, 201);
  margin-bottom: 3px;
}
</style>
